Repository navigation
Put the orca CLI on PATH at install time for headless hosts - #5842
Conversation
The bundled orca/orca-ide CLI is only registered on PATH by the in-app 'Install CLI' action (CliInstaller via the cli:install IPC), which can never run on a headless server. As a result, 'orca serve' was unreachable from the shell on exactly the hosts that need it. Register the CLI at install time instead, through the channels we control: - Homebrew cask (orca + orca@rc): add a 'binary' stanza pointing at the bundled shim so 'brew install --cask orca' symlinks 'orca' into Homebrew's on-PATH bin. No GUI needed. - deb/rpm: add after-install/after-remove fpm scripts that symlink the bundled orca-ide shim to /usr/bin/orca-ide on install and remove it on uninstall. Guards avoid clobbering an unrelated /usr/bin/orca-ide (e.g. GNOME Orca) and only remove a symlink that still points into an Orca install dir. The shims resolve the real app by walking symlinks, so a PATH symlink works. The deb already declares the xvfb dependency 'orca serve' needs for browser panes, so apt/dnf installs now give a working headless serve in one step. Verified the postinstall/postremove logic in Debian and Fedora containers: symlink created + CLI invokable via PATH, args forwarded, both clobber guards hold, and uninstall cleans up only our own symlink. Co-authored-by: Orca <help@stably.ai>
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit ce8ec83 on Jun 19, 2026 9:18pm UTC. |
📝 WalkthroughWalkthroughThe pull request adds PATH-accessible CLI registration for the bundled 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4652798f-8060-4fd4-812b-bcb078961236
📒 Files selected for processing (5)
Casks/orca.rbCasks/orca@rc.rbconfig/electron-builder.config.cjsresources/linux/packaging/after-install.shresources/linux/packaging/after-remove.sh
| if [ ! -e "$link" ] || [ -L "$link" ]; then | ||
| ln -sf "$shim" "$link" |
There was a problem hiding this comment.
Avoid overwriting unrelated existing symlinks at /usr/bin/orca-ide.
Current logic force-replaces any symlink target, so an unrelated symlink at the same path gets clobbered. That contradicts the script’s own safety contract.
Suggested fix
- if [ ! -e "$link" ] || [ -L "$link" ]; then
- ln -sf "$shim" "$link"
- fi
+ if [ ! -e "$link" ]; then
+ ln -s "$shim" "$link"
+ elif [ -L "$link" ]; then
+ current_target="$(readlink "$link" || true)"
+ case "$current_target" in
+ /opt/Orca/*|/opt/orca-ide/*|/opt/orca/*)
+ ln -sf "$shim" "$link"
+ ;;
+ esac
+ fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ ! -e "$link" ] || [ -L "$link" ]; then | |
| ln -sf "$shim" "$link" | |
| if [ ! -e "$link" ]; then | |
| ln -s "$shim" "$link" | |
| elif [ -L "$link" ]; then | |
| current_target="$(readlink "$link" || true)" | |
| case "$current_target" in | |
| /opt/Orca/*|/opt/orca-ide/*|/opt/orca/*) | |
| ln -sf "$shim" "$link" | |
| ;; | |
| esac | |
| fi |
…#5842) Co-authored-by: Orca <help@stably.ai>
What & why
The bundled
orca/orca-ideCLI only lands onPATHwhen a user triggers the in-app Install CLI action (CliInstaller, via thecli:installIPC). That requires opening the desktop GUI — which a headless server can never do. So on the exact hosts where you'd wantorca serve(VMs, cloud boxes), the CLI was unreachable from the shell after install.This registers the CLI at package-install time, through the distribution channels we control, so
orca serveworks on a headless host with no GUI step.How
Casks/orca.rb+Casks/orca@rc.rb): add abinarystanza pointing at the bundled shim (Orca.app/Contents/Resources/bin/orca).brew install --cask orcanow symlinksorcainto Homebrew's already-on-PATHbin dir. The cask is the source of truth synced to the tap byhomebrew-bump.yml, so this propagates automatically on the next release.config/electron-builder.config.cjs+resources/linux/packaging/*.sh): addafterInstall/afterRemovefpm scripts that symlink the bundled…/resources/bin/orca-ideto/usr/bin/orca-ideon install and remove it on uninstall. The deb already declares thexvfbdependencyorca serveneeds to render browser panes headlessly, soapt installnow yields a working headless serve in one step.The shims resolve the real app by walking up symlinks, so a
PATHsymlink works correctly. The install dir is discovered (not hardcoded/opt/Orca) because electron-builder's directory name can vary.Safety guards
/usr/bin/orca-ide(e.g. Ubuntu's GNOME Orca) — it only writes when the path is absent or already a symlink.Verification
Ran the postinstall/postremove logic against mock install trees in real Debian (
debian:stable-slim) and Fedora (fedora:latest) containers:orca-ideresolves onPATH, runs, forwards args (orca-ide serve --foo)/usr/bin/orca-ideAlso confirmed both casks pass
ruby -c, the builder config loads, and electron-builder 26.8.1 supportsafterInstall/afterRemove(they map to fpm--after-install/--after-remove).Scope / not included
ln -selsewhere; out of scope here.Follow-ups (not blocking)
binaryfrom anauto_updatesapp: confirm the symlink survives an in-app updater swap (path inside the.appis stable, so it should).Made with Orca 🐋